import request from '@/utils/request'

// 新增班级
export function createStudent(data) {
  return request({
    url: '/student/create',
    method: 'post',
    data: data
  })
}

// 获取班级列表
export function getStudentList(query) {
  return request({
    url: '/student/list',
    method: 'get',
    params: query
  })
}

// 用户根据班级id获取详情
export function getStudentById(id) {
  return request({
    url: `/student/${id}`,
    method: 'get',
  })
}

// 修改班级
export function updateStudentById(params) {
  return request({
    url: `/student/update/${params.id}`,
    method: 'put',
    data: params
  })
}

// 用户根据班级id删除
export function deleteStudentById(id) {
  return request({
    url: `/student/delete/${id}`,
    method: 'delete'
  })
}

// 关联创建手环/学生
export function createStudentWristband(data){
  return request({
    url: '/student/createStudentWristband',
    method: 'post',
    data: data
  })
}

// 用户根据学生id回收
export function deleteStuWb(params) {
  return request({
    url: `/student/deleteStuWb/${params.sid}`,
    method: 'delete',
    params: params
  })
}
